#pragma once
#define WIN32_LEAN_AND_MEAN

#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdlib.h>
#include <stdio.h>

// Need to link with Ws2_32.lib
#pragma comment (lib, "Ws2_32.lib")
// #pragma comment (lib, "Mswsock.lib")

#define DEFAULT_BUFLEN 512
#define DEFAULT_PORT "27015"

class Command;

class ClientComm
{
public:
	ClientComm();
	~ClientComm();
public:
	bool Send(Command* Cmd);
private:
	bool Connect(Command* Cmd);
private:
	WSADATA wsaData;
    SOCKET ConnectSocket;
    struct addrinfo *result, *ptr, hints;
    char recvbuf[DEFAULT_BUFLEN];
    int iResult, recvbuflen;
	u_long NonBlocking;
};